<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page isELIgnored='false'%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="conversation.css" rel="STYLESHEET" type="text/css">
<title>Conversation List</title>
<jsp:include page="scripts/js_tools.jsp" />
<!--  jsp:include page="scripts/export.jsp" / -->
</head>
<body>
<!--        Header         -->
<jsp:include page="scripts/headerAnnotate.jsp">
<jsp:param name="title" value="Assigned Conversations" />
</jsp:include>
<!--        List           -->
<div class="list">
 <c:if test="${anno_user.role == 1}">
 <jsp:include page="scripts/clist_filter.jsp"/>
<!--        List           -->
<%-- for (java.util.Enumeration<String> e = session.getAttributeNames(); e.hasMoreElements() ;) out.println(e.nextElement() + ", "); --%>
<table>
  <tr>
    <th>Id</th>
    <th>Month</th>
    <th>Year</th>
    <th># Turns</th>
    <th># Msgs</th>
    <th># Type1</th>
    <th>Assigned to</th>
    <th>Label</th>
    <th></th>
  </tr>
  <c:forEach items="${conversations}" var="conversation">
    <tr>
      <td align="center">
        <a href='annotateconversation.html?conversationId=<c:out value="${conversation.conversationId}"/>'>
          <c:out value="${conversation.conversationId}" /> 
        </a>
      </td>
      <td align="center"><c:out value="${conversation.month}" /></td>
      <td align="center"><c:out value="${conversation.year}" /></td>
      <td align="center"><c:out
        value="${conversation.numMessageTurns}" /></td>
      <td align="center"><c:out value="${conversation.numMessages}" /></td>
      <td align="center"><c:out
        value="${conversation.numType1Messages}" /></td>
      <td>
      <c:forEach items="${conversation.assignments}" var="assignment">
    		<c:if test="${assignment.status == '0'}"><font color="red"></c:if>
    		<c:if test="${assignment.status == '1'}"><font color="green"></c:if>
    		  <c:out value="${assignment.user.userName}"></c:out> 
    	  </font>
      </c:forEach>
      </td>
      <td align="center"><c:out
        value="${conversation.conversationLabel.label}" /></td>
      <td align="center">
        <a href='annotateconversation.html?conversationId=<c:out value="${conversation.conversationId}"/>'>        
      [annotate] </a></td>
    </tr>
  </c:forEach>
</table>
</c:if>
</div>
<jsp:include page="scripts/footer.jsp" />
</body>
</html>
